package com.ok.common.utils

import android.util.Base64
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson

class ByteArrayToBase64Adapter {

    @FromJson
    fun fromJson(value: String): ByteArray {
        return Base64.decode(value, Base64.NO_WRAP)
    }

    @ToJson
    fun toJson(value: ByteArray): String {
        return Base64.encodeToString(value, Base64.NO_WRAP)
    }
}